package com.biancheng.biancheng.biancheng2;

import java.util.*;

public class 化装晚会 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        List<Integer> a = new ArrayList<Integer>();


        String[] s = scanner.nextLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int l = Integer.parseInt(s[1]);

        for (int i = 0; i < n; i++) {
            a.add(scanner.nextInt());
        }

        Collections.sort(a);

        int count = 0;
        for (int i = 0; i <= n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                if (a.get(i) + a.get(j) <= l) {
                    count++;
                } else {
                    break;
                }
            }
        }
        System.out.println(count);
    }


}
